//
//  LeftTableViewCell.m
//  XLZChat
//
//  Created by dllo on 16/10/21.
//  Copyright © 2016年 徐昊. All rights reserved.
//  LST LeftTableView的自定义Cell

#import "LeftTableViewCell.h"
#import "Masonry.h"

@interface LeftTableViewCell ()


@end

@implementation LeftTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatSubView];
    }
    return self;
}
// 创建子控件
- (void)creatSubView {
    self.leftImage = [[UIImageView alloc] init];
    _leftImage.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:_leftImage];
    [_leftImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.bounds.size.width /8);
        make.width.mas_equalTo(self.bounds.size.width / 5);
        make.top.mas_equalTo(self.mas_top).offset(10);
        make.bottom.mas_equalTo(self.mas_bottom).offset(-10);
    }];
    self.nameLabel = [[UILabel alloc] init];
    _nameLabel.backgroundColor = [UIColor orangeColor];
    _nameLabel.textColor = [UIColor whiteColor];
    _nameLabel.font = [UIFont systemFontOfSize:15];
    _nameLabel.numberOfLines = 0;
    _nameLabel.textAlignment = 1;
    [self.contentView addSubview:_nameLabel];
    [_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_leftImage.mas_right).offset(20);
        make.top.mas_equalTo(_leftImage.mas_top);
        make.bottom.mas_equalTo(_leftImage.mas_bottom);
        make.width.mas_offset(self.bounds.size.width / 3);
    }];
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
